import {
    Base
} from '../../utils/base'
const base = new Base()
class OrderDetail extends Base {
    constructor() {
        super()
    }

    /**
     * 获取订单详情
     * @param {*} id
     */
    getOrderData(id) {
        return base.getRequest(`order/${id}`)
    }

    /**
     * 下单
     * @param {*} order
     */
    placeOrder(order) {
        return base.postRequest(`pay`, order)
    }

    /**
     * 取消订单
     * @param {*} id
     */
    cancelOrder(id) {
        return base.putRequest(`order/${id}`)
    }

    /**
     * 取消/未通过订单恢复预约数量
     * @param {*} id
     */
    restoreSubscribeNumber(id) {
        return base.putRequest(`num/${id}`)
    }

    /**
     * 取消交管中心订单
     * @param {*} lsh
     */
    cancelCarOrder(lsh) {
        return base.putRequest(`car/subscribe/${lsh}`)
    }

    /**
     * 退款
     * @param {*} id
     */
    refundOrder(id) {
        return base.putRequest(`refund/${id}`)
    }
}

export {
    OrderDetail
}